package fun.symtable;

import java.util.Iterator;

public class VariableIterator extends SymbolTableIterator<VariableEntry> {

    public VariableIterator(SymbolTable table, Iterator<VariableEntry> iter) {
	super(table, iter);
    }

    public boolean hasNext() {
	if (true == iterator.hasNext())
	    return true;
	// false == iter.hasNext()
	this.table = this.table.getParent();
	// no parent symtable
	if (null == table)
	    return false;
	iterator = this.table.variables();
	return iterator.hasNext();
    }
}
